﻿<?php
use Carbon\Carbon;
?>
<!doctype html>
<html>
<head>
<script src="/blue/js/jquery.js"></script>
<link href="/blue/css/css.css" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="format-detection" content="telephone=no" />
<meta charset="utf-8">
<title>无标题文档</title>
<style>
.news{ width:92%; height:105px; background:#fff; position:relative; padding-left:4%; padding-right:4%;}
.news h3{ font-size:16px; color:#191919;padding-top:10px; padding-bottom:10px;}
.news h3 span{ color:rgb(200,200,200); float:right; }
.news p{ color:rgb(200,200,200);}
</style>
</head>

<body style="background-color: #f9f9f9;">
<!--header顶部标题-->
<div class="header">消息中心
  <div class="header_left" onClick="window.history.go(-1)"><img src="/blue/images/return.png"></div>
</div>
<?php $dqsj = Carbon::now(); ?>
@foreach ($res as $v)
	<?php
		$sj = Carbon::createFromDate($v->craeted_at);
		$hm = strtotime($sj);
		$dqhm = strtotime($dqsj);
	?>
		<div class="news">
			<h3>{{ $v->title }}
                <?php if(date("Y-m-d",$hm) < date("Y-m-d",strtotime("-6 day"))){?>
                    <span>七天前</span>
                <?php }elseif(date("Y-m-d",$hm) < date("Y-m-d",strtotime("-5 day"))){?>
                    <span>六天前</span>
                <?php }elseif(date("Y-m-d",$hm) < date("Y-m-d",strtotime("-4 day"))){?>
                    <span>五天前</span>
                <?php }elseif(date("Y-m-d",$hm) < date("Y-m-d",strtotime("-3 day"))){?>
                    <span>四天前</span>
			    <?php }elseif(date("Y-m-d",$hm) < date("Y-m-d",strtotime("-2 day"))){?>
				    <span>三天前</span>
			    <?php }elseif(date("Y-m-d",$hm) < date("Y-m-d",strtotime("-1 day"))){ ?>
				    <span>前天</span>
			    <?php }elseif (date("Y-m-d",$hm) < date("Y-m-d",$dqhm)){ ?>
				    <span>昨天</span>
			    <?php }else{?>
				    <span>{{ substr($v->craeted_at, 10, -3) }}</span>
			    <?php }?>
			</h3>
		    <p>{{ $v->content }}</p>
		    <div class="border_bottom"></div>
		</div>
@endforeach
<script>

</script>
</body>
</html>

